<div id="sidebar">
    <div id="">
        <h2><?php __('Actions'); ?></h2>

           <div class="actions">
                <ul>
                    <?php
                    if($event_time != 'past')
                    {
                    ?>
                    <li><?php echo $this->Html->link(__('Edit Event', true), array('action' => 'edit', $event['Event']['id'])); ?> </li>

                       
                       
                    <?php

                    }
                    ?>

                     <li><?php echo $this->Html->link(__('Back', true), array('action' => 'index')); ?> </li>
                </ul>
            </div>
        <br />
         <div class="actions">
             <div class="related">
                 <h2><?php __('Related Event Hosts'); ?></h2>
                 <?php if (!empty($event['EventHost'])): ?>
                     <table cellpadding = "0" cellspacing = "0">
                         <tr>
                             <th><?php __('Id'); ?></th>
                             <th><?php __('Host id'); ?></th>
                             <th><?php __('Host Type'); ?></th>
                         </tr>
                     <?php
                     $i = 0;
                     foreach ($event['EventHost'] as $eventHost):
                         $class = null;
                         if ($i++ % 2 == 0) {
                             $class = ' class="altrow"';
                         }
                     ?>
                         <tr>
                             <td><?php echo $eventHost['id']; ?></td>
                             <td><?php echo $eventHost['host_id']; ?></td>
                             <td><?php echo $eventHost['host_type']; ?></td>
                             
                     </tr>
<?php endforeach; ?>
                 </table>
<?php endif; ?>
        
                           <div class="actions">
                             <ul>
                                 <li>
                                 <?php if ($event_time != 'past')

                                 {

                                 ?>

                                 <li> <?php echo $this->Html->link(__('Assign new co-host', true), array('controller' => 'event_hosts', 'action' => 'add', $event['Event']['id'])); } ?> </li>


                             </ul>
                             </div>
                         </div>
     
        </div>

        
    </div>
</div>


<div class="events view">

    <h2><?php __('Event report'); ?></h2>

    <h3><?php echo $event['Event']['event_name'].' Outlook'; ?></h3>
    <div class="event_listing">

            <div class="event_listing_left">
                <?php
                    if(file_exists('img/event/'.$event['Event']['id'].'.jpg')){
                        echo $this->Html->image('event/'.$event['Event']['id'].'.jpg',array('height'=>'90','width'=>'90'));
                    }else{
                        echo $this->Html->image('default_event.jpg',array('height'=>'90','width'=>'90'));
                    }
                ?>
            </div>

            <div class="event_listing_right">
                <p><span class="small_title">Attending: </span><?php echo $attending; ?></p>
                <p><span class="small_title">Not attending: </span><?php echo $not_attending; ?></p>
                <p><span class="small_title">Awaiting: </span><?php echo $awaiting; ?></p>
                <p><span class="small_title">Remaining capacity: </span><?php echo $remaining_capacity.'/'.$event['Event']['capacity']; ?></p>
            </div>
        
            <div class="event_listing_detail"></div>
            <div id="event_listing_clear"></div>
    </div>
    
    <h3>Guest reviews</h3>
    <div class="event_listing">

        <?php

            if (!empty($reviews_list)){

            $j = 0;
            foreach ($reviews_list as $review):
                
       ?>

        <div class="event_listing_left">
            <?php
                if(file_exists('img/profile/user/'.$users_list[$j]['User']['id'].'.jpg')){
                    echo $this->Html->image('profile/user/'.$users_list[$j]['User']['id'].'.jpg',array('height'=>'90','width'=>'90'));
                }else{
                    echo $this->Html->image('default_user.jpg',array('height'=>'90','width'=>'90'));
                }
            ?>
        </div>

        <div class="event_listing_right">
            <h4><?php echo $users_list[$j]['User']['first_name'].' '.$users_list[$j]['User']['last_name']; ?></h4>
            <p><span class="small_title">Comment: </span><?php echo $review['Review']['comment']; ?></p>
            <p><span class="small_title">Rating: </span><?php for($i=0 ; $i<$review['Review']['rating']; $i++) echo '*'; ?></p>
            <p><span class="small_title">Reviewed at: </span><?php echo $review['Review']['review_ts']; ?></p>
        </div>

        <div class="event_listing_detail"></div><div id="event_listing_clear"></div>

        <?php $j++; endforeach;

            }else{?>
        
        <div class="event_listing_detail2">
            <p><span class="small_title">There are no reviews available.</span></p>
        </div>

        <?php } ?>

    </div>

</div>
